Skip to content

Adapt parameter#339

Open
eatbreads wants to merge 2 commits intoeloqdata:mainfrom
eatbreads:adapt_parameter
Open

Adapt parameter#339
eatbreads wants to merge 2 commits intoeloqdata:mainfrom
eatbreads:adapt_parameter

Conversation

@eatbreads
Copy link
Collaborator

@eatbreads eatbreads commented Nov 28, 2025

Summary by CodeRabbit

  • New Features
    • Eloq storage configuration now includes new options to specify cloud storage daemon ports and enable cloud cache prewarming at startup
    • Cloud storage daemon ports can be configured as comma-separated values, enabling flexible distributed storage setup
    • Cloud cache prewarming capability allows systems to optimize performance during server initialization

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

Walkthrough

This PR adds two new configuration options to EloqGlobalOptions: eloqStoreCloudStoreDaemonPorts (string for cloud daemon ports) and eloqStorePrewarmCloudCache (boolean flag). These are declared in the header, registered in global options configuration, and wired into the KV engine.

Changes

Cohort / File(s) Change Summary
Configuration Structure
src/mongo/db/modules/eloq/src/eloq_global_options.h
Added two public data members to EloqGlobalOptions: eloqStorePrewarmCloudCache (bool, default false) and eloqStoreCloudStoreDaemonPorts (std::string).
Option Registration & Storage
src/mongo/db/modules/eloq/src/eloq_global_options.cpp
Added option declarations in EloqGlobalOptions::add() for storage.eloq.storage.eloqStoreCloudStoreDaemonPorts (String) and storage.eloq.storage.eloqStorePrewarmCloudCache (Bool). Updated EloqGlobalOptions::store() to populate these fields from parsed parameters.
KV Engine Integration
src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp
Added parsing of comma-separated eloqStoreCloudStoreDaemonPorts string into a vector and wired both new options into EloqStoreConfig as cloud_store_daemon_ports and prewarm_cloud_cache.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • String parsing logic for comma-separated daemon ports in eloq_kv_engine.cpp
  • Verify option descriptions align with intended behavior
  • Confirm wiring consistency across the three files

Possibly related PRs

Suggested labels

trigger-ci

Suggested reviewers

  • xiexiaoy
  • liunyl

Poem

🐰 Two new options hop into place,
Cloud daemon ports and cache with grace,
From headers to engine, the config flows free,
Prewarming the cache for all to see! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Adapt parameter' is overly vague and does not clearly summarize the main changes. The PR adds two new Eloq store configuration options (cloud storage daemon ports and prewarm cloud cache flag) and their corresponding implementations, but the title provides no meaningful information about what parameters are being adapted or why. Consider a more descriptive title such as 'Add eloqStoreCloudStoreDaemonPorts and eloqStorePrewarmCloudCache options' or 'Add cloud storage daemon ports and prewarm cache configuration options' to clearly convey the main changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp (1)

190-202: Ports parsing logic is sound; consider trimming whitespace as a nicety

The comma‑separated parsing into cloud_store_daemon_ports is correct and guarded on non‑empty input. If you expect admins to write values like "5572, 5573, 5574", you might optionally trim leading/trailing whitespace from token before pushing to ports, to keep the config canonical.

-        while (std::getline(tokenStream, token, ',')) {
-            if (!token.empty()) {
-                ports.emplace_back(token);
-            }
-        }
+        while (std::getline(tokenStream, token, ',')) {
+            // Trim spaces so "5572, 5573" works as expected.
+            auto first = token.find_first_not_of(" \t");
+            if (first == std::string::npos) {
+                continue;
+            }
+            auto last = token.find_last_not_of(" \t");
+            ports.emplace_back(token.substr(first, last - first + 1));
+        }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd17707 and c6b5cfe.

📒 Files selected for processing (3)
  • src/mongo/db/modules/eloq/src/eloq_global_options.cpp (4 hunks)
  • src/mongo/db/modules/eloq/src/eloq_global_options.h (2 hunks)
  • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-14T03:10:22.027Z
Learnt from: githubzilla
Repo: eloqdata/eloqdoc PR: 279
File: src/mongo/db/dbmain.cpp:0-0
Timestamp: 2025-11-14T03:10:22.027Z
Learning: In this repository, avoid defining --config via gflags in src/mongo/db/dbmain.cpp; MongoDB’s options_parser owns --config. Prefer gflags flags with a distinct prefix (e.g., --data_substrate_config) parsed before options_parser, with options_parser configured to allow unregistered options.

Applied to files:

  • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp
📚 Learning: 2025-11-24T03:11:24.955Z
Learnt from: lzxddz
Repo: eloqdata/eloqdoc PR: 325
File: src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp:1362-1384
Timestamp: 2025-11-24T03:11:24.955Z
Learning: The EloqDoc codebase uses an older version of glog that supports the two-parameter signature `google::InitGoogleLogging(const char* argv0, PrefixCallback)` for custom log prefix formatting, as seen in src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp line 1383.

Applied to files:

  • src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp
🔇 Additional comments (7)
src/mongo/db/modules/eloq/src/eloq_kv_engine.cpp (2)

27-27: <sstream> include is appropriate

Needed for the new std::istringstream usage below; inclusion is correct and localized.


268-269: prewarm_cloud_cache flag is correctly wired through

Propagating eloqStorePrewarmCloudCache directly into eloq_store_config.eloqstore_configs_.prewarm_cloud_cache is consistent with the other EloqStore options here.

src/mongo/db/modules/eloq/src/eloq_global_options.h (1)

121-150: New EloqStore option fields are well‑placed with safe defaults

Adding eloqStorePrewarmCloudCache (default false) and eloqStoreCloudStoreDaemonPorts (empty string) in the EloqStore block keeps configuration cohesive and matches how they’re consumed in store() and configureEloqStore.

src/mongo/db/modules/eloq/src/eloq_global_options.cpp (4)

428-433: Cloud store daemon ports option is declared consistently

The storage.eloq.storage.eloqStoreCloudStoreDaemonPorts String option, with an empty default, lines up with the new std::string eloqStoreCloudStoreDaemonPorts field and the parsing logic in configureEloqStore.


583-588: Prewarm cloud cache option integrates cleanly

The Bool option storage.eloq.storage.eloqStorePrewarmCloudCache (default false) matches the eloqStorePrewarmCloudCache field and is described clearly for users.


997-1000: Storing cloud daemon ports from params is straightforward

Conditionally assigning eloqStoreCloudStoreDaemonPorts from the corresponding parameter when present mirrors existing patterns and lets downstream code distinguish “unset” (empty string) from “set but empty” via params.count.


1089-1092: Prewarm flag storage follows existing Bool option conventions

The eloqStorePrewarmCloudCache flag is stored only when the CLI/config option is present, with the default remaining false otherwise, which is consistent with other EloqStore Bool options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant